$(function(){
   $('#login').on('click',function(e){
       e.preventDefault()
     let  username=  $('#username').val().trim()
     let  password=  $('#password').val().trim()

     $.post('http://localhost:8080/api/v1/admin/user/login',{username,password},function(res){
         if(res.code===200){
            location.assign('http://127.0.0.1:5500/index.html')
             localStorage.setItem('token',res.token)
             
         }else{
             console.log('登录失败',res)
         }
     })
   })
})